﻿using CommonBase;
using InteractiveWhiteboardManagement.Base;
using InteractiveWhiteboardManagement.Base.ViewModels;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Prism.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace TreeMgtModule.ViewModels
{
    /// <summary>
    /// 分类统计
    /// </summary>
    public class ViewModel_CategoryStatistics : WorkspaceViewModel
    {
        #region 构造函数

        public ViewModel_CategoryStatistics(IRegionManager regionManager)
        {
            if (regionManager == null)
                return;

            base.BaseRegionManager = regionManager;
            base.ViewName = InteractiveWhiteboardManagement.Base.Common.ViewNames.TreeMgtModule_CategoryStatistics;
            base.HeaderTitle = "统计界面";
            base.HeaderImageSource = string.Format(ConstantString.IMAGE_URL, "ShowDetail");
            base.IsShowCloseButton = Visibility.Collapsed;

            _leafSumCount = _leafOKCount = _leafConnectionCount = 
                _leafDisconnectionCount = _leafWrongCount = 0;
        }

        #endregion

        #region 属性

        private int _leafSumCount;
        /// <summary>
        /// 设备总数
        /// </summary>
        public int LeafSumCount
        {
            get
            {
                return _leafSumCount;
            }
            set
            {
                if (_leafSumCount == value) return;
                _leafSumCount = value;
                base.OnPropertyChanged("LeafSumCount");
            }
        }

        private int _leafOKCount;
        /// <summary>
        /// 正在使用
        /// </summary>
        public int LeafOKCount
        {
            get
            {
                return _leafOKCount;
            }
            set
            {
                if (_leafOKCount == value) return;
                _leafOKCount = value;
                base.OnPropertyChanged("LeafOKCount");
            }
        }

        private int _leafConnectionCount;
        /// <summary>
        /// 停止使用
        /// </summary>
        public int LeafConnectionCount
        {
            get
            {
                return _leafConnectionCount;
            }
            set
            {
                if (_leafConnectionCount == value) return;
                _leafConnectionCount = value;
                base.OnPropertyChanged("LeafConnectionCount");
            }
        }

        private int _leafDisconnectionCount;
        /// <summary>
        /// 断开连接
        /// </summary>
        public int LeafDisconnectionCount
        {
            get
            {
                return _leafDisconnectionCount;
            }
            set
            {
                if (_leafDisconnectionCount == value) return;
                _leafDisconnectionCount = value;
                base.OnPropertyChanged("LeafDisconnectionCount");
            }
        }

        private int _leafWrongCount;
        /// <summary>
        /// 错误 IP
        /// </summary>
        public int LeafWrongCount
        {
            get
            {
                return _leafWrongCount;
            }
            set
            {
                if (_leafWrongCount == value) return;
                _leafWrongCount = value;
                base.OnPropertyChanged("LeafWrongCount");
            }
        }

        #endregion
    }
}
